Ext.onReady(function () {
	console.log("On ready")
	
	var data = [];

	data.push({Day: 'Sun', TweetsNoURL: 8.0, TweetsWithURL: 8.0, ReTweetsNoURL: 8.0, ReTweetsWithURL: 8.0, Mean: 30.0, StdDev1Below: 20.0, StdDev1Above: 40.0});		// <- new stuff here
	data.push({Day: 'Mon', TweetsNoURL: 8.0, TweetsWithURL: 8.0, ReTweetsNoURL: 8.0, ReTweetsWithURL: 8.0, Mean: 33.0, StdDev1Below: 23.0, StdDev1Above: 43.0});		// <- new stuff here
	data.push({Day: 'Tue', TweetsNoURL: 8.0, TweetsWithURL: 8.0, ReTweetsNoURL: 8.0, ReTweetsWithURL: 8.0, Mean: 28.0, StdDev1Below: 18.0, StdDev1Above: 38.0});		// <- new stuff here
	data.push({Day: 'Wed', TweetsNoURL: 8.0, TweetsWithURL: 8.0, ReTweetsNoURL: 8.0, ReTweetsWithURL: 8.0, Mean: 34.0, StdDev1Below: 24.0, StdDev1Above: 44.0});		// <- new stuff here
	data.push({Day: 'Thu', TweetsNoURL: 8.0, TweetsWithURL: 8.0, ReTweetsNoURL: 8.0, ReTweetsWithURL: 8.0, Mean: 33.0, StdDev1Below: 23.0, StdDev1Above: 43.0});		// <- new stuff here
	data.push({Day: 'Fri', TweetsNoURL: 8.0, TweetsWithURL: 8.0, ReTweetsNoURL: 8.0, ReTweetsWithURL: 8.0, Mean: 34.0, StdDev1Below: 24.0, StdDev1Above: 44.0});		// <- new stuff here
	data.push({Day: 'Sat', TweetsNoURL: 8.0, TweetsWithURL: 8.0, ReTweetsNoURL: 8.0, ReTweetsWithURL: 8.0, Mean: 30.0, StdDev1Below: 20.0, StdDev1Above: 40.0});		// <- new stuff here
		
	var store1 = new Ext.data.JsonStore({
		fields: ['Day', 'TweetsNoURL', 'TweetsWithURL', 'ReTweetsNoURL', 'ReTweetsWithURL', 'Mean', 'StdDev1Below', 'StdDev1Above'], // <- new stuff here
		data: data
	});

    var chart = Ext.create('Ext.chart.Chart', {
            style: 'background:#fff',
            theme: 'Category1',
            store: store1,
			legend: {				// <- new stuff here
                position: 'right'	// <- new stuff here
            },						// <- new stuff here
            axes: [{
                type: 'Numeric',
                position: 'left',
                fields: ['Day', 'TweetsNoURL', 'TweetsWithURL', 'ReTweetsNoURL', 'ReTweetsWithURL', 'Mean', 'StdDev1Below', 'StdDev1Above'], 	// <- new stuff here
                title: 'Tweet Volume',
                grid: true
            }, {
                type: 'Category',
                position: 'bottom',
                fields: ['Day'],	// <- new stuff here
                title: 'Day of the Week'
			}],
            series: [{
                type: 'column', 
                axis: 'left',   
                xField: 'Day',  																// <- new stuff here
                yField: ['TweetsNoURL', 'TweetsWithURL', 'ReTweetsNoURL', 'ReTweetsWithURL'], 	// <- new stuff here
				stacked: true, 																	// <- new stuff here
				tips: {																			// <- new stuff here
                    trackMouse: true,															// <- new stuff here
                    width: 165,																	// <- new stuff here
                    height: 28,																	// <- new stuff here
                    renderer: function(storeItem, item) {										// <- new stuff here
						console.log(item);														// <- new stuff here
						console.log(storeItem);													// <- new stuff here
                        this.setTitle(String(item.value[1]) + " " + item.yField);				// <- new stuff here
                    }																			// <- new stuff here
				}																				// <- new stuff here
            }, {
                type: 'scatter',
                axis: 'left',
                xField: 'Day', 	// <- new stuff here
                yField: 'Mean',	// <- new stuff here
                markerConfig: {
                    type: 'circle',
                    size: 5
                }
            }, {
                type: 'line',
                axis: 'left',
                smooth: true,
                xField: 'Day',			// <- new stuff here
                yField: 'StdDev1Above',	// <- new stuff here
				markerConfig: {
                    type: 'cross',
                    size: 5
                }
            }, {
                type: 'line',
                axis: 'left',
                smooth: true,
                xField: 'Day',			// <- new stuff here
                yField: 'StdDev1Below',	// <- new stuff here
				markerConfig: {
                    type: 'cross',
                    size: 5
                }
            }]
        });
	
	var container1 = Ext.create('Ext.container.Container', {
		layout: 'fit',
		width: 600,
		height: 100,
		border: 1,
		style: {
			boderColor: '#000000',
			borderStyle: 'solid',
			borderWidth: '1px'
		},
		items: chart
	}); 

	Ext.define("StatsWindow", {
        extend : 'Ext.window.Window',
        modal : false,
        width : 600,
        height : 400,
		items: container1,
        layout : 'fit',
        initComponent : function() {
			console.log("Show stuff here")
            this.callParent();
        }
    });
	
	Ext.create("StatsWindow").show();
	
});
